Skip to content

Update mypy and make AbstractSaveable.save return Self type #1261

Merged
merged 8 commits into from
May 23, 2023

Conversation

Mr-Geekman
Copy link
Contributor

@Mr-Geekman Mr-Geekman commented May 5, 2023

Before submitting (must do checklist)

  • Did you read the contribution guide?
  • Did you update the docs? We use Numpy format for all the methods and classes.
  • Did you write any new necessary tests?
  • Did you update the CHANGELOG?

Proposed Changes

Closing issues

@@ -163,7 +166,7 @@ def get_etna_version() -> Tuple[int, int, int]:
return result


class SaveMixin:
class SaveMixin(AbstractSaveable):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't work without this somehow.

@github-actions
Copy link

github-actions bot commented May 5, 2023

@github-actions github-actions bot temporarily deployed to pull request May 5, 2023 15:41 Inactive
@codecov-commenter
Copy link

codecov-commenter commented May 5, 2023

Codecov Report

Merging #1261 (cc097a6) into master (a9ed603) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##           master    #1261   +/-   ##
=======================================
  Coverage   87.98%   87.98%           
=======================================
  Files         186      186           
  Lines       10751    10754    +3     
=======================================
+ Hits         9459     9462    +3     
  Misses       1292     1292           
Impacted Files Coverage Δ
etna/core/mixins.py 95.30% <100.00%> (+0.06%) ⬆️
etna/core/saving.py 83.33% <100.00%> (ø)
etna/ensembles/mixins.py 100.00% <100.00%> (ø)
...mental/classification/feature_extraction/weasel.py 95.65% <100.00%> (+0.09%) ⬆️
etna/models/base.py 86.55% <100.00%> (-0.08%) ⬇️
etna/models/mixins.py 96.26% <100.00%> (+0.01%) ⬆️
etna/pipeline/mixins.py 99.02% <100.00%> (ø)
etna/transforms/base.py 92.66% <100.00%> (-0.05%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Mr-Geekman Mr-Geekman self-assigned this May 5, 2023
@martins0n
Copy link
Contributor

@GrozniyToaster plz help

@GrozniyToaster
Copy link
Collaborator

It looks like it won't work without inheritance.

Mypy is bad at checking abstract class signatures, you can try with Protocols

@GrozniyToaster GrozniyToaster marked this pull request as ready for review May 15, 2023 07:01
@github-actions github-actions bot temporarily deployed to pull request May 23, 2023 07:30 Inactive
@github-actions github-actions bot temporarily deployed to pull request May 23, 2023 08:33 Inactive
Copy link
Collaborator

@GrozniyToaster GrozniyToaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks nice

Copy link
Collaborator

@GrozniyToaster GrozniyToaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks nice v2

@Mr-Geekman Mr-Geekman merged commit 372ee0f into master May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants